package com.chapal.ib.activemq.client;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;

import org.apache.log4j.Logger;

import com.chapal.ib.util.xml.XmlUtil;

public class HistoricalDataListener implements MessageListener {
	boolean verbose = true;
	static final Logger logger = Logger.getLogger(HistoricalDataListener.class);

	@Override
	public void onMessage(Message message) {
		try {
			if (message instanceof ObjectMessage) {
				final Object obj = ((ObjectMessage) message).getObject();
				HistoricalDataListener.logger.debug("Received:ObjectMessage:" + XmlUtil.toXML(obj));
			}
		} catch (final JMSException e) {
			HistoricalDataListener.logger.error("", e);
		} finally {

		}
	}
}
